<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateServerNoticesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('server_notices', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('server_id')->comment('游戏服id');
            $table->integer('site_type')->comment('位置.1:跑马灯2:系统消息3:对话框');
            $table->text('content')->comment('公告内容');
            $table->tinyInteger('notice_type')->default('1')->comment('1:普通2:定时');
            $table->dateTime('start_time')->comment('开始时间')->nullable();
            $table->dateTime('end_time')->comment('结束时间')->nullable();
            $table->integer('frequency')->comment('0：只发一次，N为多少分钟一次')->nullable();
            $table->integer('time_num')->default(0)->comment('定时公告执行次数');
            $table->string('client_ip');
            $table->string('admin_user');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('server_notices');
    }
}
